package com.example.dog.core.actions.impl;

import com.example.dog.core.actions.EatBehavior;
import com.example.dog.core.annotation.SysLog;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Random;
@NoArgsConstructor
@Data
public class DogThinkBehavior extends EatBehavior {
    public DogThinkBehavior(int tired){
        this.tired = tired;
    }
    @Override
    @SysLog("思考")
    public void execute(String name) {
        this.setTired(this.getTired() - 1);
        System.out.println(name + "正在思考...");
        Random r = new Random();
        try {
            Thread.sleep(r.nextInt(59)*1000 + 50000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
